﻿using System;
using System.Collections.Generic;
using System.Text;
using OL.FrameCore.Application.User.Dto;
using OL.FrameCore.Infrastructure.Code;
using Microsoft.EntityFrameworkCore;
using OL.FrameCore.Application.Module.Dto;

namespace OL.FrameCore.Application.User
{
    public interface IUserService :  IAutoInject
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        LoginResponse VerifyLogin(LoginRequest request);

        /// <summary>
        /// 获取登录用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        GetLoginUserInfoResponse GetLoginUserInfo(int userId);

        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        GetUserResponse GetUser(int userId);
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        PageData<GetUserListResponse> GetUserList(GetUserListRequest request);
        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Result AddUser(AddUserRequest request);
        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Result UpdateUser(UpdateUserRequest request);
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="opeatorId"></param>
        /// <returns></returns>
        Result DeleteUser(int userId, int opeatorId);
        /// <summary>
        /// 启用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="opeatorId"></param>
        /// <returns></returns>
        Result EnableUser(int userId, int opeatorId);
        /// <summary>
        /// 禁用用户
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="opeatorId"></param>
        /// <returns></returns>
        Result DisableUser(int userId, int opeatorId);
        /// <summary>
        /// 重置密码
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Result RetsetPassword(RetsetPasswordRequest request);
        /// <summary>
        /// 获取用户分配的角色
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        GetUserRoleResponse GetUserRole(int userId);
        /// <summary>
        /// 分配角色
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Result AssignUserRole(AssignUserRoleRequest request);
        /// <summary>
        /// 获取用户分配的模块
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        GetUserModuleResponse GetUserModule(int userId);
        /// <summary>
        /// 分配模块
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Result AssignUserModule(AssignUserModuleRequest request);
        /// <summary>
        /// 获取所有模块列表
        /// </summary>
        /// <returns></returns>
        IList<GetModuleListModel> GetUserMenu(int userId);
        /// <summary>
        /// 记录登录日志
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Result LogLogin(LogLoginRequest request);
    }
}
